﻿@using AmorCanino.Web.Models.Authentication
@{
    var isAuthenticated = AuthUser.Current() != null;
    var totalUnreaded = 0;
    if (isAuthenticated) {
        totalUnreaded = AuthUser.Current().UnreadedMessages;
    }
}
<div class="cartDetail">
    @if (isAuthenticated)
    {
        <div>
            @if (totalUnreaded > 0) 
            {
            <a href="@Url.Action("messages","account")" style="text-decoration:none; color: White;"><span>@totalUnreaded</span> <img src="@Url.Content("~/Content/envelope.png")" /></a><span> - </span>
            }
            @Html.ActionLink(AuthUser.Current().Name, "Index", "Account", null, new { style = "color:white;" }) - @Html.ActionLink("Desloguear", "logout", "account", null, new { style = "color:white;" })
        </div>
        <div class="cartContent"><img src="@Url.Content("~/Content/cartIcon.gif")" style="vertical-align:bottom; margin-right:5px;" />1 Artículo en el Carrito</div>
        <div class="cartAmmount">$99.00</div>
        <div class="cartButton"><div class="ActionButton" data-ref="">Comprar</div></div>
    }
    else
    {
        <div><img src="@Url.Content("~/Content/cartIcon.gif")" style="vertical-align:bottom; margin-right:5px;" /> Ingresa para ver tus productos</div>
    }
</div>